package org.hentai.service.impl;

import jakarta.annotation.Resource;
import org.hentai.dao.HentaiUserRepository;
import org.hentai.entity.HentaiUser;
import org.hentai.service.HentaiUserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HentaiUserServiceImpl implements HentaiUserService {

    @Resource
    private HentaiUserRepository hentaiUserRepository;

    @Override
    public List<HentaiUser> getAllUser() {
        return hentaiUserRepository.findAll();
    }

    @Override
    public HentaiUser getUserById(long id) {
        return hentaiUserRepository.getReferenceById(id);
    }

    @Override
    public HentaiUser save(HentaiUser user) {
        return hentaiUserRepository.save(user);
    }
}
